<style type="text/css">
.agree{
width: 100px;
font-size: 15px;
color: #EB1C24;
font-weight: bold;
line-height: 25px;

}
.control-label{
  width: 250px;
  padding:15px 15px;
  border-right: 1px solid #e9ecee;
  line-height: 40px;
  font-family: 'Droid Sans';
}
.control-label label{
  font-family: 'Droid Sans';
  font-size: 15px;
  font-weight: normal;
  color: #EB1C24;
}
.helper-box-line{
  width: 600px;
  float: left;
  font-family: 'Droid Sans',
}
.form-group{
  border-bottom: 1px solid #e9ecee;
  margin: 0;

}
.login-form{
  width: 100%;
}

.form-control{
  width: 50%;
  margin-top: 4px;
  float: left;
}
.glyphicon-calendar{
  display: none;
}
.last{
  padding: 0px 0 0 150px;
  border: 0;
}
.last .control-label{
  border: 0;
  width: 50px;
  float: left;
}
.helper-text-justify{
  float: left;
}
.col-sm-9{
  padding: 4px 0 0 0 ;

}
.check-input{

}
.confirm{
	width: 600px;
}
.btn-r{
  margin: 80px 0 20px 0;
  border: 0;
}
.radiobutton{
  margin-top: 15px;
}
.short{
	width: 15%;
	float: left;
}
.bio{
	height: 70px;
	line-height: 55px;
}
select{
	margin:12px 0 0 0;
}
.ccaptcha{
	width: 140px;
}
.col-sm-7,.col-sm-11{
	padding: 10px 0 0 15px;
}
.register-btn{
	padding: 20px 0;
}
</style>
<div class='buybid-box'>
	<div class='buybid-top'>
		<div class='buybid-title'>Register</div>
	</div>
</div>
<div class='row region region-login '>
	
	<div class='col-xs-6 login-form'>
		<?php
			$form=$this->beginWidget('application.components.widgets.CActiveFormPlus', array(
				'id'=>'register-form',
				'enableAjaxValidation'=>true,
			    
				'enableClientValidation' => true,
				'clientOptions' => array(
					'validateOnSubmit' => true,
				    'validateOnChange'=>true,
				    'validateOnType'=>true,
				),
			)); 
		?>
		<?php //echo $form->errorSummary($model); ?>
		<!--FIRST NAME -->
		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'FIRST NAME'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->textField($model,'first_name',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'first_name'); ?>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'LAST NAME'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->textField($model,'last_name',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'last_name'); ?>
			</div>
		</div>

		

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'ADDRESS'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->textField($model,'address',array('class'=>'form-control','style'=>'width:700px')); ?>
				<?php echo $form->error($model,'address'); ?>
			</div>
		</div>


		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'CITY'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->textField($model,'city',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'city'); ?>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'ZIP CODE'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->textField($model,'zip_code',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'zip_code'); ?>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'STATE'); ?>
			</div>
			<div class="col-sm-7">
				<?php //echo $form->dropDownList($model,'states',array('1'=>'select'),array('style'=>'margin:12px 0 0 0;')); ?>
				<select name="RegisterDao[states]">
				            <?php foreach ($states as $k => $v) {?>
				            <option value="<?php echo $v->id;?>"  ><?php echo $v->name;?></option>
				            <?php }?>
						</select>
				<?php echo $form->error($model,'states'); ?>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'PHONE'); ?>
			</div>
			<div class="col-sm-7">
			    <?php echo $form->textField($model,'phone',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'phone'); ?>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'DATE OF BIRTH'); ?>
			</div>
			<div class="col-sm-7">
				<?php 
				echo $form->dateTimeFieldJs($model,'birthday',array(
                    'timeFormat'=>'HH:mm:ss',
                    'changeYear'=>true,
                    'changeMonth'=>true,
                    'yearRange'=>'-100:+0',
                    'maxDate'=>'+0d',
                    'showTimepicker'=>false,
                	),array(
                    'class'   => 'form-control',
                	'id'      => 'RegisterDao_birthday',
                	'attribute'=>'birthday',
                	'readOnly'=>true
                    // 'disabled' => $model->getScenario() == 'edit',
                    ))
				?>
				<?php echo $form->error($model,'birthday'); ?>
			</div>
			
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'EMAIL ADDRESS'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->textField($model,'email',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'email'); ?>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'RETYPE EMAIL ADDRESS'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->textField($model,'conemail',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'conemail'); ?>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'CREATE YOUR USERNAME'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->textField($model,'user_name',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'user_name'); ?>
			</div>
		</div>

		

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'CREATE PASSWORD'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->passwordField($model,'password',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'password'); ?>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'VERIFY PASSWORD'); ?>
			</div>
			<div class="col-sm-7">
				<?php echo $form->passwordField($model,'conpassword',array('class'=>'form-control')); ?>
				<?php echo $form->error($model,'conpassword'); ?>
			</div>
		</div>
       
	  
	  	 <div class="form-group">
	  		 <div class="control-group  check">
	  		 	<div class="col-sm-3 control-label">
				<?php echo $form->label($model,'Captcha'); ?>
			</div>
	  	 		<div class='col-sm-9'>
	  	 			<div class="col-sm-3 check-input">
						<?php echo $form->textField($model,'verifyCode',array('class'=>'form-control')); ?>
					</div>
					<div class="col-sm-3 ccaptcha">
						<?php $form->widget('CCaptcha',array(
				        'showRefreshButton'=>false,
				        'clickableImage'=>true,
				        'buttonLabel'=>'Refresh',
				        'imageOptions'=>array(
				        	'id'=>'myRegisterCaptcha',
				            'alt'=>'Click image change VerifyCode',
				            'title'=>'Click image change VerifyCode',
				            'style'=>'cursor:pointer',
				            'padding'=>'10')
		        		)); 
		    			?>
					</div>
					<?php echo $form->error($model,'verifyCode'); ?>
	  	 		</div>
			</div>
		</div>	
		 <div class='form-group'>
    		<div class='col-sm-3 control-label clause'>
	      			<?php echo $form->label($model,'Terms And Conditions'); ?>
	    		<?php //echo $form->error($model,'is_agree'); ?>
    		</div>
    		<div class='col-sm-9'>
	  	 				<div class="col-sm-3 check-input confirm">
	  	 					<?php echo $form->checkbox($model,'is_agree',array('uncheckValue'=>0,'value'=>1,'style'=>"width:20px; height:20px; margin-top:10px;"));?>&nbsp;<a href="javascrput:void;" onclick=area() style="margin-left:0">Check this checkbox if you agree to the terms and conditions above.</a>
	  	 					<?php echo $form->error($model,'is_agree'); ?>
	  	 					<?php echo $form->textarea($model,'is_agree_word',array('class'=>'form-control','id'=>'clause','readonly'=>"readonly",'style'=>'resize:none;width:500px;height:100px; display:none;','value'=>"I have read and agree to the egunner privacy policy and terms & conditions. I also agree that I am a resident of the United States,at least 18 years old and agree to receive email updates and the egunnernewsletter.")); ?>
	      			 	</div>
					</div>
	  	 </div>

		    <div class="col-sm-offset-2 col-sm-10 register-btn">
				<?php echo CHtml::button('Register',array('type' => 'submit','class' => 'btn btn-login'))?>
		    </div>     
	   <?php $this->endWidget(); ?>
	</div>
</div>
<script type="text/javascript">
	$(document).ready(function(){
	    var img = new Image;
	        img.onload=function(){
	            $('#myRegisterCaptcha').trigger('click');
	        }
	        img.src = $('#myRegisterCaptcha').attr('src');  //这段js解决yii验证码不刷新
	});
function area(){
	$("#clause").show();
	$(".clause").css("height","170px");
}
</script>